import { createApp } from "vue";
import i18n from "@/global/i18n_config";
import App from "./App.vue";
import router from "@router/router";
import { userState, userStateKey } from "@store/userStore";
import { dashState, dashStateKey } from "@store/dashStore";
import "@css/public.css";
import VMdEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';
import hljs from 'highlight.js';
import createKatexPlugin from '@kangc/v-md-editor/lib/plugins/katex/cdn';
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';

VMdEditor
  .use(githubTheme, {
    Hljs: hljs,
  })
  .use(createKatexPlugin());

VMdPreview
  .use(githubTheme, {
    Hljs: hljs,
  })
  .use(createKatexPlugin());



const app = createApp(App);
app
  .use(router)
  .use(i18n)
  .use(userState, userStateKey)
  .use(dashState, dashStateKey)
  .use(VMdEditor)
  .use(VMdPreview)
  .mount("#app");
